package service.interf;

import model.MUser;

public interface IUser {
	/**
	 * 添加用户
	 * @param model
	 * @return
	 * @throws Exception
	 * 2012-12-15下午10:07:30
	 * String
	 */
	public String addUser(MUser model) throws Exception;
	/**
	 * 删除用户
	 * @param userId
	 * 			用户id
	 * @return 1
	 * 			成功
	 * @throws Exception
	 */
	public String delUser(Integer userId) throws Exception;
	
	/**
	 * 删除用户
	 * @param userName
	 * @return	1
	 * 			成功
	 * @throws Exception
	 */
	public String delUser(String userName) throws Exception;
	
	/**
	 * 编辑用户
	 *
	 * @param model
	 * @return
	 * @throws Exception
	 * 2012-12-8下午01:53:36
	 * String
	 */
	public String editUser(MUser model) throws Exception;
	
	/**
	 * 查找所有用户 根据分页信息
	 * @param pageno
	 * @param pagesize
	 * @return	JSONArray
	 * 			返回分页内的所有用户
	 * @throws Exception
	 */
	public String findAll(int pageno, int pagesize) throws Exception;

	/**
	 * 通过用户编号查找用户
	 */
	public String findUserById(Integer userId) throws Exception;
		
	/**
	 * 通过用户名查找用户
	 */
	public String findUserByUserName(String userName) throws Exception;
	/**
	 * 使能用户，通过用户名
	 *
	 * @param uname
	 * @param enabled
	 * @return
	 * @throws Exception
	 * 2012-12-15下午10:40:49
	 * String
	 */
	public String enableUser(String uname, Short enabled) throws Exception;

	/**
	 * 使能用户，通过用户编号
	 *
	 * @param userId
	 * @param enabled
	 * @return
	 * @throws Exception
	 * 2012-12-15下午10:41:44
	 * String
	 */
	public String enableUser(Integer userId, Short enabled) throws Exception;
	
//	public String changePwd(Long userId, String oldpwd, String newpwd)
}


